<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%> 
<%@ page import="java.util.*,entity.Course" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>在线选课系统</title>
  <script src="js/layui/layui.js"></script>
  <link rel="stylesheet" href="js/layui/css/layui.css">
</head>
<body>
      <div style="background-color: #E2E2E2; padding: 15px;">
        <h2 style="color: teal;" align="center">在线选课系统</h2>
        <table class="layui-table">
          <thead>
      		
            <tr>
              <th>课程编号</th>
              <th>课程名</th>
              <th>授课老师</th>
              <th>学分</th>
              <th>上课时间</th>
              <th>上课地点</th>
              <th>限选人数</th>
              <th>已选人数</th>
              <th>操作</th>
            </tr> 
          </thead>
          <tbody>
          <c:forEach var="student" items="${sessionScope.selectAll }">
            <tr>
            <td>${student.getCourse_id() }</td>
            <td>${student.getCourse_name() }</td>
            <td>${student.getTeacher() }</td>
            <td>${student.getPoint() }</td>
            <td>${student.getTime1() }<br>${student.getTime2() }</td>

            <td>${student.getLocation() }</td>
            <td>${student.getLimited() }</td>
            <td>${student.getSelected() }</td>
         
            <td>

          <a href="StudentInsertServlet?course_id=${student.getCourse_id()}" type="button" class="layui-btn layui-btn-normal layui-btn-sm">
                 选课</a>
           </td>
         
          </tr>
          </c:forEach>
          </tbody>
        </table>
      </div>
  <script>
    //JavaScript代码区域
    layui.use('element', function() {
      var element = layui.element;
    });
  </script>
</body>

</html>